package com.neuedu.dao.impl;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.neuedu.dao.FoodMakeDao;
import com.neuedu.model.FoodMake;

@Repository
public class FoodMakeDaoImpl implements FoodMakeDao {

	// 代码层级的整合spring+mybatis
	@Autowired
	private SqlSessionTemplate sqlSessionTemplate;

	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}

	@Override
	public int countFoodMake() {
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).countFoodMake();
	}

	@Override
	public List<FoodMake> findAll(Map<String, Object> map) {
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).findAll(map);
	}

	@Override
	public int addFoodMake(FoodMake fm) {
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).addFoodMake(fm);
	}

	@Override
	public int updateFoodMake(FoodMake fm) {
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).updateFoodMake(fm);
	}

	@Override
	public int deleteFoodMake(int id) {
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).deleteFoodMake(id);
	}

	@Override
	public List<FoodMake> findList(){
		// TODO 自动生成的方法存根
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).findList();
	}
	
	@Override
	public List<FoodMake> findMake() {
		// TODO Auto-generated method stub
		return sqlSessionTemplate.getMapper(FoodMakeDao.class).findMake();
	}
}
